#ifndef CPLO_H
#define CPLO_H

#include "cp.cpp"
#include <list>

#ifdef MAP_HEIGHT
#ifdef MAP_WIDTH
#ifdef N_OBJETOS

class neighborhood
{
public:
    double top[2], botton[2], left[2], right[2];
};


class cplo
{
public:
    cplo();
    double getResultanteX(int px, int py);
    double getResultanteY(int px, int py);
    void addAtrativa(int px, int py);
    void addRepulsiva(int px, int py);
    void addRepulsivaFixa(int px, int py);
    void setCteAtrativa(double d);
    void setCteRepulsiva(double d);
    void setCteRepulsivaFixa(double d);
    void setObjeto(int px, int py);
    double getCteAtrativa();
    double getCteRepulsiva();
    double getCteRepulsivaFixa();
    Vetor<double> getVetorResultante(int px, int py);
    double getAnguloResultante(int px, int py);
    double getPotencialX(int ox, int oy);
    double getPotencialY(int ox, int oy);
    void getNeighborhood(int nx, int ny);
    int getRobotListSize();
    void setRadiusOfInfluence(double v);
    double getRadiusOfInfluence();
    void calcula();
    void reset();
    void setEpsilon(double v);
    double getEpsilon();
private:
    neighborhood vizinhos;
    Vetor<double> forcaResultante[MAP_WIDTH][MAP_HEIGHT];
    double potencial[MAP_WIDTH][MAP_HEIGHT];
    int nroAtrativas;
    int nroRepulsivas;
    int nroObjetos;
    cp mapa[MAP_HEIGHT][MAP_WIDTH];
    double potencialX[MAP_HEIGHT][MAP_WIDTH];
    double potencialY[MAP_HEIGHT][MAP_WIDTH];
    double objeto[N_OBJETOS][2];
    double cteAtrativa;
    double cteRepulsiva;
    double cteRepulsivaFixa;
    double RadiusMax;
    list<int> at_x, at_y;
    list<int> rep_x, rep_y;
    list<int> repFixa_x, repFixa_y;
    double epsilon;
};

#endif
#endif
#endif
#endif
